//package com.ruoyi.framework.config;
//
//import org.apache.catalina.valves.RemoteAddrValve;
//import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//// tomcat设置访问ip的黑白名单
//@Configuration
//public class TomcatConfig {
//
//    @Bean
//    public TomcatServletWebServerFactory servletContainer(){
//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
////        TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
//        String allow = "127.0.0.1";// 允许通过的ip
////        String deny = "172.16.17.10|172.16.17.20|172.16.17.33";// 拒绝通过的ip
//        RemoteAddrValve remoteAddrValve = new RemoteAddrValve();
//        remoteAddrValve.setAllow(allow);
////        remoteAddrValve.setDeny(deny);
//        tomcat.addContextValves(remoteAddrValve);
//        return tomcat;
//    }
//}
